<?php // $Id: moosisca.php,v 1.26.2.17 2009/05/13 05:35:38 jerome Exp $
// This file defines settingpages and externalpages under the "moosisca" category
if(!defined("PATH_MOOSISCA_REPORT")){
  define("PATH_MOOSISCA_REPORT", "$CFG->wwwroot/$CFG->admin/report/moosisca");
}

//I.F. Nuevo: 2011-02-25; ramarin
if ($hassiteconfig || has_capability('report/moosisca:managecategories', $systemcontext) || has_capability('report/moosisca:newspacerequest', $systemcontext)
  || has_capability('report/moosisca:courseevaluationrequest', $systemcontext) || has_capability('report/moosisca:unapprovedcourses', $systemcontext)
  || has_capability('report/moosisca:approvedcourses', $systemcontext) || has_capability('report/moosisca:workflow', $systemcontext)
  || has_capability('report/moosisca:viewallworkflow', $systemcontext)
) {
    $ADMIN->add('root', new admin_category('moosisca', get_string('moosisca','report_moosisca')));
    $ADMIN->add('moosisca', new admin_category('moosisca_admin', get_string('requests','report_moosisca')));
    
    if ($hassiteconfig || has_capability('report/moosisca:managecategories', $systemcontext)){
      $ADMIN->add('moosisca_admin', new admin_externalpage('moosisca_managecategories', get_string('managecategories','report_moosisca'), PATH_MOOSISCA_REPORT . "/managecategories.php", 'report/moosisca:managecategories'));
    }
    
    if ($hassiteconfig || has_capability('report/moosisca:newspacerequest', $systemcontext)){
      $ADMIN->add('moosisca_admin', new admin_externalpage('moosisca_newspacerequest', get_string('newspacerequest','report_moosisca'), PATH_MOOSISCA_REPORT . "/newspacerequest.php", 'report/moosisca:newspacerequest'));   
    }
    
    if ($hassiteconfig || has_capability('report/moosisca:courseevaluationrequest', $systemcontext)){
      $ADMIN->add('moosisca_admin', new admin_externalpage('moosisca_courseevaluationrequest', get_string('courseevaluationrequest','report_moosisca'), PATH_MOOSISCA_REPORT . "/courseevaluationrequest.php", 'report/moosisca:courseevaluationrequest'));   
    }
    
    if ($hassiteconfig || has_capability('report/moosisca:unapprovedcourses', $systemcontext)){
      $ADMIN->add('moosisca_admin', new admin_externalpage('moosisca_unapprovedcourses', get_string('courseapprovation','report_moosisca'), PATH_MOOSISCA_REPORT . "/unapprovedcourses.php", 'report/moosisca:unapprovedcourses'));   
    }
    
    if ($hassiteconfig || has_capability('report/moosisca:approvedcourses', $systemcontext)){
      $ADMIN->add('moosisca_admin', new admin_externalpage('moosisca_approvedcourses', get_string('coursemigration','report_moosisca'), PATH_MOOSISCA_REPORT . "/approvedcourses.php", 'report/moosisca:approvedcourses'));   
    }
    
    if ($hassiteconfig || has_capability('report/moosisca:workflow', $systemcontext) || has_capability('report/moosisca:viewallworkflow', $systemcontext)){
      $ADMIN->add('moosisca_admin', new admin_externalpage('moosisca_workflow', get_string('courseworkflow','report_moosisca'), PATH_MOOSISCA_REPORT . "/workflow.php", 'report/moosisca:workflow'));   
    }
}
?>
